package com.lh.pospi.x_store.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lh.pospi.x_store.R;
import com.lh.pospi.x_store.modle.GoodsBean;

import java.util.List;

public class PurchaseAdapter extends BaseQuickAdapter<GoodsBean,BaseViewHolder> {
    public PurchaseAdapter(int layoutResId, @Nullable List<GoodsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsBean item) {
        helper.setText(R.id.item_name, "名称："+item.getName());
        helper.setText(R.id.item_code, "条码：" + item.getBarcode());
        helper.setText(R.id.item_price, "单价：" + item.getLsj()+"元/"+item.getUnit());
        helper.setText(R.id.item_num, "数量：" + item.getNum());
        helper.setText(R.id.item_unit, "规格：" +item.getSpec());
        helper.addOnClickListener(R.id.btn_delete);
    }
}
